﻿using Microsoft.AspNetCore.Idenmpotency;

namespace AspNetCore.Idenmptency.Test.Idenmptency
{
    public class AppIdenmpotencyRequestFactory : IAspIdenmpotencyRequestFactory
    {
        public IAspIdenmpotencyRequest Create(HttpContext context, RequestDelegate next)
        {
            var key = context.Request.Headers["IdenmpotencyKey"];
            return new AppIdenmpotencyRequest(context, next, key.ToString());
        }
    }
}
